from flask import Flask, render_template, request
app = Flask(__name__)

@app.route('/')
def index():
    print('during view')
    return 'hello world'

@app.teardown_request
def show_teardown(exception):
    print('after with block')

with app.test_request_context():
    print('during with block')

print('---------------')
with app.test_client() as client:
    client.get('/')
    print(request.path)

if __name__ == "__main__":
    app.run(host='0.0.0.0')